package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName : BrandMapper  //类名
 * @Description : 品牌mapper层  //描述
 * @Author : qingfeng  //作者
 * @Date: 2020-09-16 19:30  //时间
 */
public interface BrandMapper extends BaseMapper<Brand> {

    @Select("SELECT b.id, b.name, b.letter, b.image FROM tb_category_brand cb INNER JOIN tb_brand b ON b.id = cb.brand_id WHERE cb.category_id = #{cid}")
    List<Brand> queryByCategoryId(Long id);
}
